var App = (function() {
    return {
    	doGetRequestJson: function (config) {
			$.ajax({                                                                   
				   type: "GET",                                                                        
				   url: config.url,  
				   contentType: "application/json; charset=utf-8",                                                            
				   dataType: "json",   
				   success: config.onSucces,                                               
				   error: function(msg) {
				       console.log(msg);
				    } 
			});
    	},
    	doGetRequestText: function (config) {
			$.ajax({                                                                   
				   type: "GET",                                                                        
				   url: config.url,  
				   contentType: "application/json; charset=utf-8",                                                            
				   dataType: "text",   
				   success: config.onSucces,                                               
				   error: function(msg) {
				       console.log(msg);
				    } 
			});
    	},
    	sendForm :function(config) {
    		$.post(config.url, $('#' + config.formId).serialize(), function(data) {
    			var html = '';
    			html += '<div style="padding: 20px"><center><h3>';
    			html += data + '</h3><a href="javascript:window.location.reload()" data-role="button">OK</a><center></div>';
    		    $.mobile.sdCurrentDialog.updateBlank(html);
    		});
    	}
    }
})();
